type
        generic SW<T> = class(TObject)
                var public
                        procedure swap(var x, y : T);
        end;

        procedure SW.swap(var x, y : T);

        var
                tmp : T;

        begin
                tmp := x;
                x := y;
                y := tmp;
        end;

type
        vInt = specialize SW<Integer>;
        
var
        i, j : longint;
        a : vInt;

begin
        a := vInt.create();
        i := 2;
        j := 4;
        a.swap(i, j);
end.
